package com.ymatou.iapi.prodstock.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.ymatou.iapi.prodstock.parameter.GetCurrentTimeBean;
import com.ymatou.iapi.prodstock.service.GetCurrentTimeCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.utils.YMTDateUtil;
/**
*获取数据库当前时间
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetCurrentTime{
	private static GetCurrentTimeBean getcurrenttimeBean;
	private static GetCurrentTimeCall getcurrenttimeCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取数据库当前时间");
	}

	@Before
	public void caseUp() {
		getcurrenttimeBean=new GetCurrentTimeBean();
		getcurrenttimeCall=new GetCurrentTimeCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getcurrenttimeCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetCurrentTime_001() {
		Logger.start(true,"获取数据库当前时间");
		try {
			getcurrenttimeBean.setAppId("autotest");
			getcurrenttimeCall.setData(getcurrenttimeBean);
			getcurrenttimeCall.callService();			
			String Code = getcurrenttimeCall.getString("Code");
			Logger.verifyEquals("200", Code, "验证Code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}